define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'qrcode/index',
        add_url: 'qrcode/add',
        edit_url: 'qrcode/edit',
        delete_url: 'qrcode/delete',
        export_url: 'qrcode/export',
        modify_url: 'qrcode/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh','add'],
                cols: [[
                    {field: 'qrcode_url', minWidth: 80, title: '二维码', search: false, templet: ea.table.image}, 
                    {field: 'qrcode_remark_name', title: '二维码备注名'},
                    {field: 'scan_code_limit', title: '扫码上限',search: false},
                    {field: 'sameday_num', title: '当日扫码次数',search: false},
                    {field: 'cumulative_num', title: '累计扫码次数',search: false},
                    {field: 'create_time', title: '创建时间',search: false},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});